package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/10/26 0026
 **/
@Data
@ApiModel("工单备件物料对象")
public class WorkSpareMaterialVo {
    @ApiModelProperty(value = "备件物料ID，新增不必传，修改必传")
    private Long id;

    @NotNull(message = "结算类型不能为空")
    @NumberPattern(regexp = "^(1|2)$", required = true, message = "结算类型参数不合法")
    @ApiModelProperty(value = "收支类型：1-商家承担，2-平台承担", required = true, example = "1")
    private Integer type;

    @NotNull(message = "物料备件ID不能为空")
    @ApiModelProperty(value = "物料备件ID", required = true)
    private Long spareId;

    @NotBlank(message = "物料型号不能为空")
    @Length(max = 300, message = "物料型号长度限制 300 个字符")
    @ApiModelProperty(value = "物料型号", required = true)
    private String model;

    @Length(max = 300, message = "物料名称长度限制 300 个字符")
    @ApiModelProperty(value = "物料名称")
    private String name;

    @NotNull(message = "物料备件规格ID不能为空")
    @ApiModelProperty(value = "物料备件规格ID", required = true)
    private Long specId;

    @NotBlank(message = "物料备件规格名称不能为空")
    @Length(max = 200, message = "物料备件规格名称长度限制 200 个字符")
    @ApiModelProperty(value = "物料备件规格名称", required = true)
    private String specName;

    @Length(max = 60, message = "商品规格编号长度限制 60 个字符")
    @ApiModelProperty(value = "商品规格编号")
    private String specSku;

    @NotNull(message = "物料数量不能为空")
    @Min(value = 1, message = "物料数量至少为1，不可输入小于1的物料数量")
    @ApiModelProperty(value = "物料数量", required = true, example = "1")
    private Integer qty;

    @NotNull(message = "平台承担费用不能为空")
    @Min(value = 0, message = "物料单价最小值为0，不可输入小于0的单价")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "平台承担费用金额最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "物料单价", required = true, example = "0.0")
    private BigDecimal price;

    @NotNull(message = "向服务商支付费用不能为空")
    @Min(value = 0, message = "物料单价最小值为0，不可输入小于0的单价")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "向服务商支费用金额最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "向服务商支付费用", required = true, example = "0.0")
    private BigDecimal payNetworkPrice;

    @NotNull(message = "商家承担费用不能为空")
    @Min(value = 0, message = "物料单价最小值为0，不可输入小于0的单价")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "商家承担费用金额最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "商家承担费用", required = true, example = "0.0")
    private BigDecimal receiveFactoryPrice;

    @NotNull(message = "物料质保状态不能为空")
    @ApiModelProperty(value = "物料质保状态：false-保内，true-保外", required = true, example = "false")
    private Boolean overinsured;

    @Length(max = 200, message = "备注长度限制 200 个字符")
    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "工单服务费用图片对象")
    private List<OrderImageVo> images;

    @ApiModelProperty(value = "删除的工单费用图片对象ID")
    private List<Long> delImageIds;

}
